package com.sxfq.gds.provider.controller;

import com.netflix.appinfo.EurekaAccept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.sxfq.gds.api.system.model.User;

/**
 * Created by Administrator on 2017/7/16.
 */

@RestController
@RefreshScope
@RequestMapping("user")
public class UserController {

    @Value("${test}")
    String test;

    @Autowired
    private DiscoveryClient discoveryClient;//激活Eureka中的DiscoveryClient实现

    @RequestMapping(value = "test1",method = RequestMethod.GET)
    public String findCameraInfos() {
        return "test1";
    }

    @RequestMapping(value = "test2",method = RequestMethod.GET)
    public User test(){
        User user=new User();
        user.setId(1l);
        user.setName("123");
        System.out.println("7072");
        return user;
    }


    @RequestMapping(value = "test3")
    public String test3(){
        return test;
    }
}
